package com.test.util;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101800715172";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCq1WYR6ZGVgriw30W0DyklJEx3BJNKXHmT21+9+X7wC7k0tx53h267ySdyv8Um3b412c3g0cpXgRv0WLUKJbKUlsK9fTisTK+j8Zf4gFQ4rSPjtiDCMa/dUhHCc/eTPMWMnRFTaUD5hjxdyPhV6c+xgrEsDVn66au6zlO6fc0NbsllyjCMYecesZVKCT+t7jldaahYmuhnTpHVIfcJyO902DZuV7mG+PJoa7tp/CdEUpxplQ5O6En8Cr67ma2js/uA6DrM0IEXa18Qp+e41sH8aqlua1XtzUF0INxk+GPEVgzO65A2voguNPBg2gvFuADmWs/j8AVkFQ1ugnEHA11BAgMBAAECggEBAKhCw+QEr/YY6Ryc7SSqghYpKH9ZrFFjwAPX4PdW1KZOhb7cVk/Yv0KKoCYvqFndskmMG3HCcI+7hPMopDg4ZSphS7IjsjxS0/SgMtT6YPnp3x2b96wOEG/nM8LZQhJtmw4ibjw/wVWD19Vv6tmED6OBXExNYkD3AsReEK3w1pTQ2+v76TDn+y3kE2eGAGKhK7k2t9WT+Ezg0bSKcxK9Tt8k+DDnYjPTfd560ZgMQOetSHKMLdWzd768LOZyS9/XeIcpGd2PLpxNiOLeJ9gEYz4mVscqLsq6qj0DXBVmBlMTssfLrqLRGKr71evPRJ9TfsyN5sjezU2FJGGcNZTrrRkCgYEA0TM9LoN5DJ4zQTI+8mdOZw8f1L1dG6LoVRyXIrcXuDM5CIKcPcmAApTQDr//dN25VX/EOQeve9iKoFOzLzlXQBeFWCJ0Ut+c+coScs1Bt7LZGexUCoIinxkuv1eb/1swVnmm5Lm41vTHNtxXzZC4OPgnTUrE11G2SLAWs9LzshcCgYEA0QzuR4GqyVya2KKv3YuoJgZaUhYXKA0jRjnKe+DaYCzFBllye3c0mvK40tw8Yr/i/LAZ6mCbRfLAcIF93RrtcGPNwUEDYgnpfG1ZuigTz0nK1zK0kz1e3Y9MJr3sUw0vfiVdtX8R2IzQYpwiC0IsZ61tU/K4gjw1d8UzQno+umcCgYA252u3OWoblal+AuHiXJqHEcEY5Fn7VtYDAG3p/oOLJGZjhWPcE3Y1NzkjpeA1m7t4ZP/qt8mmhz5atZzhV/s+Ju4oI2LEHUvlgtM0rgoBXD7+PrgPyfesKb/LGAMpEZWuHF9gyB1qzPM7wriIiuLOkNI/xs/Ccv+UNCLBLywmIQKBgF4uqzOAEcfCduje8sinYMww1IRi+2/J63h6FOWWugvWX7Wqms9RN1wPuoEVRAdhWAxr8mELwSjUYyrMzD3PIeYesNY+Sh3jRVQPl/ssjzA2mLI3X+9uGM1NAAv8SPpp2FnGz98zLoEXf9LNcPENkR/snHLTyZizM4uQRrXOiXBFAoGBALUKloVzaC0QKhTEJ1Gtgqpl6DAZtgHsKW3s5Sb6isrVSais/ArPorHuYB/BP+QHymzCaOKdrJLNIvY0l+cl1DSOIpo/AN1zYKT40SyqIzT9+E/dms6amg2Ae3GOlccoU7YzeILMAJ1J3fEO00TKXIA5taqhyr+Ml0DvpL5XpZzy";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5L07Zr9vVDEF3DzvLVyEuYU6Jn3haFWg7zqt/HiwHNV34SQrsC6RqX7kPFa3BYqZcg7kEMyUZLZLNkB7MO1J96295a2nk811X77LeZsyPHGKrxYgcUVf3zfiaj777E6TPptT1j5aOHvg1QBLXICZo+0nsuUWwkuM8lZXcN3JnRmdoEvwiQKRNT6F+WT9g2XTKvQP2Kc154p2EJrFidimfy6zRWqk4KNPiuT5rj2vwALgG+M0LrL3r5IesJLm6WCByHjEPIJx1Fy5CnMVlKV2xZ6q+mgEjQqLjgQI33rUuIv+WQss8+VtK48j7J1oqGuWkZA/XyMjRUi0vjdTQSLUnwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//支付宝付款成功后，将结果返回给商户这边的指定路径
    public static String notify_url = "http://localhost:8080/testShop/pay/notifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//支付宝付款成功后，跳转到商户这边的指定路径
    public static String return_url = "http://localhost:8080/testShop/pay/returnUrl";

	// 签名方式
	public static String sign_type = "RSA2";	
	// 字符编码格式
	public static String charset = "utf-8";	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

